package com.lyl.security.controller;

import com.lyl.security.common.result.ErrorCode;
import com.lyl.security.common.result.Result;
import com.lyl.security.common.utils.ServletUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
public class TestController {

    @GetMapping("/hello")
    public String hello(){
        return "hello,world";
    }

    @GetMapping("/str")
    public void Str(HttpServletResponse response){
        ServletUtils.write(response,Result.build(ErrorCode.SYSTEM_ERROR));
    }
}
